package com.efivestar.idm.api;

import org.apache.catalina.util.URLEncoder;
import org.apache.commons.codec.digest.DigestUtils;
import org.junit.Test;

import java.nio.charset.Charset;

public class TemplateApplicationTest2 {


    @Test
    public void testA(){
        String str = DigestUtils.sha1Hex("jsapi_ticket=sM4AOVdWfPE4DxkXGEs8VMCPGGVi4C3VM0P37wVUCFvkVAy_90u5h9nbSlYy3-Sl-HhTdfl2fzFy1AOcHKP7qg&noncestr=Wm3WZYTPz0wzccnW&timestamp=1414587457&url=http://mp.weixin.qq.com?params=value");
        System.out.println(str);

    }

    @Test
    public void testGetOAuth2AccessTokenUrl(){
//        WeixinApi weixinApi = new WeixinApi();
//        String oAuth2AccessTokenUrl = weixinApi.getOAuth2AccessTokenUrl("http://51ai.cc/helloHtml", WeiXinOAuth2ScopeEnum.SNSAPI_BASE, null);
//        System.out.println(oAuth2AccessTokenUrl);


        String encodeRedirectUrl = URLEncoder.QUERY.encode("http://aadfsa", Charset.defaultCharset());
        String encodeRedirectUrl2 = URLEncoder.DEFAULT.encode("http://aadfsa", Charset.defaultCharset());
        System.out.println(encodeRedirectUrl);
        System.out.println(encodeRedirectUrl2);
    }



}
//0f9de62fce790f9a083d5c99e95740ceb90c27ed
//df6b82babbdad0be7af3dac71ae3ca1e03984851a7f0358d5a7061667ab40cbd